package com.weigee.ktv.view.dialog

import android.os.Bundle
import android.view.Gravity
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ProgressBar
import com.linde.library.util.DisplayUtil

/**
 * Created by linde on 2017/5/30.
 *<p/>
 */
class LoadingDialog : BaseDialog() {
    override fun setDialogStyle(): Int {
        return com.linde.library.R.style.DialogStyle
    }

    override fun setGravity(): Int {
        return Gravity.CENTER
    }

    override fun setMinimumWidth(): Int? {
        return DisplayUtil.displayMetrics(context)?.widthPixels
    }

    override fun setMinimumHeight(): Int? {
        return DisplayUtil.displayMetrics(context)?.heightPixels
    }

    override fun onCreateView(inflater: LayoutInflater?, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        isCancelable = false
        return ProgressBar(context)
    }

    override fun onBackPressed() {
        super.onBackPressed()
        dismiss()
    }
}